package com.lh.pattern.singleton;

/**
 ************************************************
 ** Module : 单例模式    (饥汉模式)
 ** Date: 2013-3-13  Time: 下午03:52:07 
 ** Author lh 
 ************************************************ 
 */
public class HungrySingleton {
	private static HungrySingleton singleton = null;
	
	/**
	 *  构造方法私有化 防止其它地方new一个对象
	 */
	private HungrySingleton(){		
	}
	
	public static synchronized HungrySingleton getInstance() {
		if(null==singleton){
			singleton =  new HungrySingleton();
		}		
		return singleton;
	}

}
